package com.liehacker.android.mapservice;

import com.liehacker.android.R;

import android.app.Activity;
import android.content.Context;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.TextView;

public class C24_ChangeFormat extends Activity{
	
	LocationManager mLocMan;
	String mStrProvider;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);		
		setContentView(R.layout.c24_changeformat);
		
		double longlatitude = 37.519576;
		double longitude = 126.940245;
		
		String strTemp = "";
		strTemp = String.format("63빌딩 위치(십진수)\n%s\n%s\n\n", Double.toString(longlatitude), Double.toString(longitude));
		((TextView)findViewById(R.id.tvChangeFormatVaule)).setText(strTemp);
		
		mLocMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
		mStrProvider = mLocMan.getBestProvider(new Criteria(), true);
		
		String slat = (longlatitude > 0 ? "북위":"남위") + " " + 
					Location.convert(longlatitude, Location.FORMAT_SECONDS);		
		String sgit = (longitude > 0 ? "동경":"서경") + " " + 
					Location.convert(longitude, Location.FORMAT_SECONDS);
		
		String strResultTemp = "";
		strResultTemp = String.format("63빌딩 위치(도분초)\n%s\n%s", slat, sgit);
		((TextView)findViewById(R.id.tvChangeFormatResult)).setText(strResultTemp);
		
	}
}
